<?php
require('includes/top.php');
$disapproved_id = $_REQUEST['disapprove_id'];
$user_id = $_REQUEST['user_id'];
$date = date("d-m-y");
$sql="INSERT INTO disapproved_laptops(`laptop_id`,`user_id`,`date`,`user_name`) VALUES ('$disapproved_id','$user_id','$date','".$_SESSION['user_name']."')";
$result=mysql_query($sql);

$sql1="UPDATE laptop SET `status` = 'disapprove' WHERE laptop_id = '".trim($disapproved_id)."' and user_id = '".trim($user_id)."'";
$result1=mysql_query($sql1);

$modelname_array = explode('-',$laptop_model);

/*$sql8 = "select min(laptop_id) from laptop_details where laptop_name='".trim($modelname_array[0])."' and laptop_model='".trim($modelname_array[1])."' and status=0";
$result8 = mysql_query($sql8);
while($row8 = mysql_fetch_row($result8))
{
$minid .= $row8[0];
}*/
$sql9="UPDATE laptop_details SET `status` = '1' WHERE laptop_id = '".trim($disapproved_id)."'";
$result9=mysql_query($sql9);


echo 'Your Request has been submitted';
?>